#ifndef QCDICTDIRMODEL_H
#define QCDICTDIRMODEL_H

#include <QFileSystemModel>
#include <QMap>

// 对QFileSystemModel进行二次封装，以提供checkstate支持
//
class QcDictDirModel : public QFileSystemModel
{
    Q_OBJECT

public:
    explicit QcDictDirModel(QObject *parent = nullptr);

    Qt::ItemFlags flags(const QModelIndex &index) const override;

    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;

    bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;

private:
    bool setCheckState_(const QModelIndex &index, int state);

private:
    QMap<QString, int> checkStates_;
};

#endif // QCDICTDIRMODEL_H
